user = input("请输入用户名：")
if "A" <= user[0] <= "Z":
    for x in user:

        if "0" <= x <= "9" or "a" <= x <= "z" or "A" <= x <= "Z":
            flag = 1
        else:
            print("用户名不合法！")
            flag = 0
            break
    if flag == 1:
        print("用户名合法！")
else:
    print("用户名不合法！")
